<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/support/taglibs.jsp" %>
<jsp:useBean id="isernManager" scope="page"
    class="edu.hawaii.myisern.model.IsernManager"/>
           
<stripes:layout-render name="/support/layout/standard.jsp" title="Edit/Add Researcher" page="researchers">
<stripes:layout-component name="contents">
<stripes:errors/>
 <stripes:form action="/ResearcherForm.action" id="MyForm">

	 <table class="leftRightForm">
                <tr>
                    <th>ID:</th>
                    <td>${empty actionBean.id ? "n/a" : actionBean.id}
                        <stripes:hidden name="id"/>
                    </td>
                 </tr>
                 <tr>
                    <th>Name:</th>
                    <td><stripes:text name="researcher.name"  /></td>                 
                 </tr>
                 <tr>
                    <th>Email:</th>
                    <td><stripes:text name="researcher.email"  /></td>
                    </td>                 
                 </tr>                                  
                 <tr>
                    <th>Image Link:</th>
                    <td><stripes:text name="researcher.pictureLink"  /></td>
                    </td>                 
                 </tr>
                 <tr>
                    <th>Bio Statement:</th>
                    <td><stripes:textarea name="researcher.bioStatement"  /></td>
                    </td>                 
                 </tr>                                   
                 <tr>
                    <th>Organization:</th>
                    <td>
                        <stripes:select name="researcher.organization">
                            <stripes:options-collection collection="${isernManager.organizations}"
                            label="name" value="name" />
                        </stripes:select>
                    </td>                 
                 </tr>
                  <tr>
                    <th colspan=2 class='twocols'>or create new organization </th>
        
                 </tr>                         
                 <tr>
                    <th>New Organization:</th>
                    <td>
                        <stripes:text  name="newOrganization"  />
                    </td>                 
                 </tr>                                       
	</table>
            <div class="buttons">
                <stripes:submit name="save" value="Save"/>
                <stripes:submit name="remove" value="Remove" onclick="return confirm('Are you sure you want to remove Researcher ${actionBean.researcher.name}?')"/>
            </div>
	
</stripes:form>



    </stripes:layout-component>
</stripes:layout-render>
